{% extends "base.html" %}
{% block content %}


    {% if user.is_authenticated %}
        <p>Welcome, {{ user.username }}. Thanks for logging in.</p>

            <table class>
                <tr>
                    <th>Exams </th>
                    <th>Start date</th>
                    <th>End date</th>
                    <th>Delete</th>
                </tr>
                {% for exam in teachersExam %}
                    <form action="/disableExam/" method="POST">
                    <tr>
                        <td><a href="/takeExam/{{ exam.id }}">{{ exam.name }}</a></td>
                        <td>{{ exam.examStartDay }} </td>
                        <td>{{ exam.examEndDay }} </td>
                        <td><input id="saveForm" name="delete" type="submit" value={{ exam.id }}></td>
                    </form>
                    </tr>


                {% endfor %}
            </table>
    {% else %}
        <p>Welcome, new user. Please log in.</p>
    {% endif %}

{% endblock %}